<%-- 
    Document   : gest_evento
    Created on : 7-apr-2014, 22.28.44
    Author     : micheleprola
--%>

<%@page import="entity.Evento"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <title>SportingEventClub - Gestione Evento</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <link rel="stylesheet" type="text/css" href="CSS/BaseSite.css" />                
        <link rel="stylesheet" type="text/css" href="CSS/datepickr.css"/>
        <link rel="stylesheet" type="text/css" href="CSS/vertical-ticker.css"/>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>        
        <script type="text/javascript" src="JQuery/coin-slider.js"></script>
        <script type="text/javascript" src="JQuery/jquery.pajinate.js"></script>
        <script type="text/javascript" src="JQuery/datepickr.js"></script>
        <script type="text/javascript" src="JQuery/datepickr.min.js"></script>
        <script type="text/javascript" src="JQuery/jquery.totemticker.js"></script>
        <script type="text/javascript" src="JQuery/tabber.js"></script>    
        <link rel="shortcut icon" href= "Images/stadion-icon.png"/>
        <script type="text/javascript">
            function verificaInserimento(modulo){   
                
                var titolo=document.getElementById("titoloErr");                 
                var descrizione=document.getElementById("descrizioneErr");
                var datepick2=document.getElementById("datepick2Err");
                var parterre=document.getElementById("parterreErr");
                var arancio=document.getElementById("arancioErr");
                var rosso=document.getElementById("rossoErr");
                var blu=document.getElementById("bluErr");                
                var verde=document.getElementById("verdeErr");
                var giallo=document.getElementById("gialloErr");
                                
                var patternSpecialChar = /^([a-zA-Z\xE0\xE8\xE9\xF9\xF2\xEC\x27]\s?)$/;              

                
                titolo.style.visibility = "hidden";
                descrizione.style.visibility = "hidden";
                datepick2.style.visibility = "hidden";                
                parterre.style.visibility = "hidden";
                arancio.style.visibility = "hidden";
                blu.style.visibility = "hidden";
                rosso.style.visibility = "hidden";
                verde.style.visibility = "hidden";
                giallo.style.visibility = "hidden";

                var i =0;
                if(modulo.titolo.value == "" || !(patternSpecialChar.test(modulo.titolo.value)))
                {
                    titolo.style.visibility = "visible";
                    modulo.titolo.focus();
                    i;                   
                } 
                if(modulo.descrizione.value== "" || !(patternSpecialChar.test(modulo.descrizione.value)))
                {    
                    descrizione.style.visibility = "visible";
                    i;
                }
                if(modulo.datepick2.value== "" || !(patternCodFisc.test(modulo.datepick2.value)))
                {    
                    datepick2.style.visibility = "visible";
                    i;
                }                
                if(modulo.parterre.value =="")
                {
                    parterre.style.visibility = "visible";                  
                    i;
                }                              
                if(modulo.arancio.value=="")
                {
                    arancio.style.visibility = "visible";
                    i;
                }
                if(modulo.blu.value=="")
                {  
                    blu.style.visibility = "visible";
                    i;
                }                
                if(modulo.rosso.value=="")
                { 
                    rosso.style.visibility = "visible";
                    i;
                }
                if(modulo.verde.value=="")
                {     
                    verde.style.visibility = "visible";
                    i;
                }
                if(modulo.giallo.value=="")
                {
                    giallo.style.visibility = "visible";
                    i;
                }                 
                if(i > 0)
                    return false;
                else
                    return true;
            }                      
        </script>
        <script type="text/javascript">
        $(function(){
          $(".text").each(function(i){
            len=$(this).text().length;
            if(len>80)
            {
              $(this).text($(this).text().substr(0,80)'...');
            }
          });
        });
        </script>
        <script type="text/javascript">
            $(document).ready(function(){
                $('#paging_container2').pajinate({
                    nav_label_first : '<<',
                    nav_label_last : '>>',
                    nav_label_prev : '<',
                    nav_label_next : '>'
                });
            });				
        </script>
        <script>
            $(document).ready(function(){
                $('li:odd, .paging > *:odd');
            });
	</script>
        <script type="text/javascript">       
		$(function(){
			$('#vertical-ticker').totemticker({
				row_height	:	'50px',
				next		:	'#ticker-next',
				previous	:	'#ticker-previous',
				mousestop	:	true
			});
		});
        </script>
        <script language="javascript" type="text/javascript">
            $(document).ready(function(){ 
                $(".productDescription").hide();
                $(".show_hide").show(); 
                $('.show_hide').click(function(){
                $(".productDescription").slideToggle();
                    return false;
                }); 
            });
        </script>
    </head>
    <body>
        <div class="main">
            <div class="page">
                <div class="header">       
                    <div class="login">
                        <%@include file="login.jsp"%>
                    </div>
                    <div class="banner">
                    </div>
                    <div class="topmenu">
                         <%@include file="topmenu.jsp" %>
                    </div>
                </div>
                <div class="content">
                    <div class="content-in">
                        <div class="left-panel">
                            <div class="left-panel-in">
                                <%
                                String op = request.getParameter("op");
                                if(op!= null && op.equals("singoloEvento")){%>
                                    <jsp:include page="ServletEvento"/>
                                <%}
                                if(user == null || flag != 1){ %>
                                    <%@include file="erroresession.jsp"%>
                                <%}else{%>
                                    <%                                             
                                    if(op.equals("inserisciEvento")){%>
                                        <% session = request.getSession();
                                               String res = (String) (request.getAttribute("inserimentoEvento"));
                                               //System.out.println("-------------------------------");
                                               String upl = (String) (request.getAttribute("messageUpload"));
                                               //System.out.println("-------------------------------"  upl);
                                        %>
                                        <%if(res==null){%>
                                            <section class='insertModule'>
                                                <h1>Inserimento nuovo evento</h1>
                                                <br/><br/><br/>
                                                <fieldset style="border-style: ridge; border-color: #0088ff; width:500px; margin-left: 115px;">
                                                    <legend style="text-align: left; font-size: 15px; color: red;">Upload locandina</legend>
                                                    <form action="ServletUpload" method="post" enctype="multipart/form-data">
                                                        <table>
                                                            <tr>
                                                                <td>
                                                                    <%  if(upl.equals("upload") || upl.equals("errore")){%>
                                                                            <img src="Images/anteprima.jpg" width="150px" height="150px">
                                                                    <%} else {%>
                                                                            <img src="<%=request.getAttribute("urlUpload")%>" width="150px;" height="150px;">
                                                                    <%  }%>
                                                                </td>
                                                                <td>&nbsp;</td><td>&nbsp;</td>
                                                                <td>
                                                                    <input type="file" name="fileName"/>
                                                                    <%if(upl.equals("upload")){%>
                                                                        <input type="submit" value="Upload"/>
                                                                    <%}else{
                                                                        if(upl.equals("errore")){%>
                                                                            <input type="submit" value="Upload"/><h3 style="color: red; margin-left: 15px; display: block;">Errore nell'upload</h3>
                                                                        <%}else{%>
                                                                            <input type="submit" value="Upload"/><h3 style="color: green; margin-left: 15px; display: block;">Upload avvenuto</h3>                                                               
                                                                    <%
                                                                        }
                                                                     }
                                                                    %>
                                                                </td>
                                                            </tr>
                                                        </table>      
                                                    </form>
                                                </fieldset>
                                                <%if(upl.equals("avvenuto")){%>
                                                    <fieldset id="dettaglievento" class="dettaglievento">
                                                        <p style="text-align: center; font-size: 15px; color: red;">Dettagli evento</p>
                                                        <form action="GeneralController" method="post" onsubmit="return verificaInserimento(this);">
                                                            <table width="85%" border="0" align="center">
                                                                <tr>
                                                                    <th>
                                                                        <label> 
                                                                            <div> Titolo evento :</div>
                                                                        </label>
                                                                        <div>
                                                                            <input type="text" name="titolo" id="titolo"/> 
                                                                        </div>
                                                                    </th>
                                                                    <th>
                                                                        <label> 
                                                                            <div>Data evento: </div>
                                                                        </label>
                                                                        <div>
                                                                            <input type="text" id="datepick2" name="datepick2" size="30">                                                  
                                                                            <script type="text/javascript">
                                                                                new datepickr('datepick2', {
                                                                                    'dateFormat': 'd/m/y'                                  
                                                                                });
                                                                            </script>
                                                                        </div>
                                                                    </th>
                                                                    
                                                                </tr>
                                                                <tr>
                                                                    <th>
                                                                        <div class="errorMessage" id="titoloErr">
                                                                            <div>Inserire il titolo dell'evento</div>
                                                                        </div>    
                                                                    </th>
                                                                    <th>
                                                                        <div class="errorMessage" id="datepick2Err">
                                                                            <div>Inserire la data dell'evento</div>
                                                                        </div>      
                                                                    </th>
                                                                </tr>
                                                                <tr>
                                                                    <th>
                                                                        <label> 
                                                                            <div>Descrizione evento: </div>
                                                                        </label>
                                                                        <div>
                                                                            <textarea cols="40" rows="5" name="descrizione" id="descrizione" value=""></textarea>                                                                     
                                                                        </div>    
                                                                    </th>
                                                                    <th>
                                                                        <label> 
                                                                            <div>Orario :</div>
                                                                        </label>
                                                                        <div>
                                                                            <select name="orario" id="orario">
                                                                                <option value="18.00">18.00</option>
                                                                                <option value="18.15">18.15</option>
                                                                                <option value="18.30">18.30</option>
                                                                                <option value="18.45">18.45</option>
                                                                                <option value="19.00">19.00</option>
                                                                                <option value="19.15">19.15</option>
                                                                                <option value="19.30">19.30</option>
                                                                                <option value="19.45">19.45</option>
                                                                                <option value="20.00">20.00</option>
                                                                                <option value="20.15">20.15</option>
                                                                                <option value="20.30">20.30</option>
                                                                                <option value="20.45">20.45</option>
                                                                                <option value="21.00">21.00</option>
                                                                                <option value="21.15">21.15</option>
                                                                                <option value="21.30">21.30</option>
                                                                                <option value="21.45">21.45</option>
                                                                            </select> 
                                                                        </div>
                                                                    </th>
                                                                </tr>
                                                                <tr>
                                                                    <th>
                                                                            <div class="errorMessage" id="descrizioneErr">
                                                                                <div>Inserire la descrizione dell'evento</div>
                                                                            </div>      
                                                                    </th>
                                                                    <th></th>
                                                                </tr>
                                                            </table>
                                                  
                                                            <table width="60%" border="0" align="center">
                                                                <tr>
                                                                    <th><div align="left">Prezzo settore parterre:</div></th>
                                                                    <th><input type="text" name="parterre" id="parterre" style="width: 50px;"/>&nbsp;€</th>
                                                                    <th>
                                                                        <div class="errorMessage" id="parterreErr">
                                                                                <div align="right">Inserire il costo del settore</div>
                                                                        </div>    
                                                                    </th>
                                                                </tr>
                                                                <tr>
                                                                    <th><div align="left">Prezzo settore arancio :</div></th>
                                                                    <th><input type="text" name="arancio" id="arancio" style="width: 50px;"/>&nbsp;€</th>
                                                                    <th>
                                                                        <div class="errorMessage" id="arancioErr">
                                                                                <div align="right">Inserire il costo del settore</div>
                                                                        </div>     
                                                                    </th>
                                                                </tr>
                                                                <tr>
                                                                    <th><div align="left">Prezzo settore rosso : </div></th>
                                                                    <th><input type="text" name="rosso" id="rosso" style="width: 50px;"/>&nbsp;€</th>
                                                                    <th>
                                                                        <div class="errorMessage" id="rossoErr">
                                                                                <div align="right">Inserire il costo del settore</div>
                                                                        </div>    
                                                                    </th>
                                                                </tr>
                                                                <tr>
                                                                    <th><div align="left">Prezzo settore blu : </div></th>
                                                                    <th><input type="text" name="blu" id="blu" style="width: 50px;"/>&nbsp;€</th>
                                                                    <th>
                                                                        <div class="errorMessage" id="bluErr">
                                                                            <div align="right">Inserire il costo del settore</div>
                                                                        </div>
                                                                    </th>
                                                                </tr>
                                                                <tr>
                                                                    <th><div align="left">Prezzo settore verde :</div></th>
                                                                    <th><input type="text" name="verde" id="verde" style="width: 50px;"/>&nbsp;€</th>
                                                                    <th>
                                                                        <div class="errorMessage" id="verdeErr">
                                                                            <div align="right">Inserire il costo del settore</div>
                                                                        </div> 
                                                                    </th>
                                                                </tr>
                                                                <tr>
                                                                    <th><div align="left">Prezzo settore giallo :</div></th>
                                                                    <th><input type="text" name="giallo" id="giallo" style="width: 50px;"/>&nbsp;€</th>
                                                                    <th>
                                                                        <div class="errorMessage" id="gialloErr">
                                                                            <div align="right">Inserire il costo del settore</div>
                                                                        </div>
                                                                    </th>   
                                                                </tr>
                                                                <tr><th>&nbsp;</th></tr>
                                                                <tr>
                                                                    <th colspan="3">
                                                                        <input type="hidden" id="locandina" name="locandina" value="<%=request.getAttribute("urlUpload")%>"/>    
                                                                        <button type="submit" class="myButton blue" id="btnsubmit" name="submit" value="inserimentoEv">Inserisci Evento</button>
                                                                    </th>
                                                                </tr>
                                                            </table>
                                                        </form>
                                                    </fieldset>
                                                <%}%>                
                                            </section>
                                        <%} else{%>
                                            <jsp:include page="/ServletEvento"/>                         
                                        <%}%>
                                     <%}else if(op.equals("visualizzaEventi")){
                                        List<Evento> eventi = (List<Evento>)request.getAttribute("listaeventi");
                                        if(eventi.isEmpty()){
                                     %>
                                            <h3 style="text-align: center;">Non sono presenti eventi in programma</h3>
                                     <% } else  {%>                    
                                            <div id="paging_container2">
                                                <ul class="paging">                    
                                             <%
                                                int i = 0;
                                                while(i<eventi.size()){ 
                                             %>
                                                    <li>
                                                        <table class="visualizzaEventi">
                                                            <tbody>
                                                                <form  action="GeneralController" method="post">
                                                                    <input type="hidden" id="idevento" name="idevento" value="<%=eventi.get(i).getId()%>">
                                                                    <% 
                                                                     if(i%2==0){%>
                                                                     <tr class="riga_pari">
                                                                     <%}
                                                                     else{%>
                                                                         <tr class="riga_dispari">
                                                                    <%}
                                                                     String [] data = eventi.get(i).getDataEvento().toString().split("-");
                                                                   %>
                                                                    <td height = "100px">
                                                                        <img src = "<%=eventi.get(i).getLocandina()%>" width = "100px" height = "100px">
                                                                    </td>
                                                                    <td width="250px">
                                                                        <h3><u><%=eventi.get(i).getTitoloEvento()%></u></h3>
                                                                    </td>
                                                                    <td width="75px">
                                                                        <%=data[2]%> - <%=data[1]%> - <%=data[0]%>
                                                                    </td>   
                                                                    <td>
                                                                        <button type="submit" class="btnev" name="submit" value="visualizzaSingoloEvento" style="text-align:center;">
                                                                            <img src="Images/visualizza_icon.png" height="25px" width="25px" style="block:inline; position:absolute;"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Visualizza
                                                                        </button>
                                                                        <%
                                                                        if(request.getAttribute("operation").equals("modifica")){
                                                                        %>
                                                                            &nbsp;&nbsp;<button type="submit" class="btnev" name="submit" value="modificaSingoloEvento" style="text-align:center;"><img src="Images/edit-event-icon.png" height="25px" width="25px" style="block:inline; position:absolute;"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Modifica</button>
                                                                        <%
                                                                        }
                                                                        else if(request.getAttribute("operation").equals("cancella")){%>
                                                                            &nbsp;&nbsp;<button type="submit" class="btnev" name="submit" value="cancellaSingoloEvento" style="text-align:center;"><img src="Images/delete-event-icon.png" height="25px" width="25px" style="block:inline; position:absolute;"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Cancella</button> 
                                                                        <%}
                                                                        else if(request.getAttribute("operation").equals("prenota")){%>
                                                                            &nbsp;&nbsp;<button type="submit" class="btnev" name="submit" value="prenotaSingoloEvento" style="text-align:center;"><img src="Images/prenota-event-icon.png" height="25px" width="25px" style="position: absolute;"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Prenota</button>    
                                                                        <%}%>
                                                                    </td>
                                                                    </tr>
                                                                    <%i++;%>
                                                                </form>
                                                            </tbody>
                                                        </table>
                                                    </li>
                                             <%
                                                }
                                             %>
                                            </ul>
                                            <p style="align:center;"><div class="page_navigation"></div></p>
                                            </div>
                                        <%}%>
                                    <%} else if(op.equals("modificaSingoloEvento")){
                                            String titolo = (String) request.getAttribute("titoloevento");
                                            String locandina = (String) request.getAttribute("locandinaevento");
                                            Long idevento = (Long) request.getAttribute("idevento");
                                            String data = (String) request.getAttribute("dataevento");
                                            String orari = (String) request.getAttribute("orari");
                                            String descrizione = (String) request.getAttribute("descrizioneevento");
                                            float parterre = (Float) request.getAttribute("prezzoparterre");
                                            float blu = (Float) request.getAttribute("prezzoblu");
                                            float verde = (Float) request.getAttribute("prezzoverde");
                                            float arancio = (Float) request.getAttribute("prezzoarancio");
                                            float rosso = (Float) request.getAttribute("prezzorosso");
                                            float giallo = (Float) request.getAttribute("prezzogiallo");
                                    %> 
                                            <form action="GeneralController" method="post">
                                                <div class="evento">   
                                                    <table width="720" height="400" border="0" style="text-align:left;">
                                                        <tr>
                                                            <td height="46" colspan="2"><input name="titoloev" value="<%=titolo%>" style="font-size:25px;"><br/>                                                        </tr>
                                                        <tr>
                                                            <td rowspan="5" style="width:300px;"><img src="<%=locandina%>" height="280px" width="280px"/></td>
                                                        </tr>
                                                        <tr style="margin-left:10px; margin-top: 15px;">
                                                            <td><h3><u>Id evento</u>:<br/><%=idevento%><input type="hidden" name="idevento" value="<%=idevento%>"></h3></td>
                                                        </tr>
                                                        <tr style="margin-left: 10px;">
                                                            <td>
                                                                <h3><u>Data evento</u>:</h3><input type="text" size="8" name="dataev" value="<%=data%>"><h3><u>Ora</u>:</h3> <input type="text" size="3" name="oraev" value="<%=orari%>">
                                                            </td>
                                                        </tr>
                                                        <tr style="margin-left: 10px;">
                                                            <td><h3><u>Descrizione evento</u>:<textarea cols="40" rows="5" name="descrizioneev" id="descrizione" value="<%=descrizione%>"><%=descrizione%></textarea></h3></td>
                                                        </tr>
                                                        <tr style="margin-left: 10px;">
                                                          <td></td>
                                                        </tr>
                                                        <tr>
                                                            <td>&nbsp</td>
                                                            <td>&nbsp</td>
                                                        </tr>
                                                    </table>                                       
                                                    <div class="prezziEv">
                                                        <table style="background-color: black; width:720px;">
                                                            <thead><tr class="riga_dispari"><th>Settore</th><th>Prezzo</th></tr></thead>
                                                            <tbody>
                                                            <tr><td></td><td></td></tr>
                                                            <tr class="riga_pari" style="width:660px;"><td>Parterre</td><td width="180px"> <input type="text" name="prezzoparterre" size="5px" value="<%=parterre%>"></td></tr>
                                                            <tr class="riga_dispari"><td>Primo anello blu</td><td width="180px"><input type="text" name="prezzoblu" size="5px" value="<%=blu%>"></td></tr>
                                                            <tr class="riga_pari"><td>Primo anello verde</td><td width="180px"><input type="text" name="prezzoverde" size="5px" value="<%=verde%>"></td></tr>
                                                            <tr class="riga_dispari"><td>Secondo anello arancio</td><td width="180px"><input type="text" name="prezzoarancio" size="5px" value="<%=arancio%>"></td></tr>                           
                                                            <tr class="riga_pari"><td>Secondo anello giallo</td><td width="180px"><input type="text" name="prezzogiallo" size="5px" value="<%=giallo%>"></td></tr>
                                                            <tr class="riga_dispari"><td>Curva rossa</td><td width="180px"><input type="text" name="prezzorosso" size="5px" value="<%=rosso%>"></td></tr>                            
                                                        </table>
                                                    </div>
                                                        <button type="submit" class="btnev" name="submit" value="updateEvento" style="text-align:center;">Salva modifiche</button>
                                                        <br/>
                                                </div>
                                            </form>
                                    <%} else if(op.equals("updateEvento")){
                                        Evento evento = (Evento)request.getAttribute("dettaglievento");
                                        String[] data = evento.getDataEvento().toString().split("-");
                                        Boolean result = (Boolean)request.getAttribute("result");
                                        if(result){
                                    %>
                                            <h1 style="text-align:center;">Modifica avvenuta con successo</h1>
                                            <div class="evento" align="center">
                                                <div class="titoloEv" align="center">
                                                    <h1><%=evento.getTitoloEvento()%></h1>
                                                    <div class="locandinaEv">
                                                        <img src="<%=evento.getLocandina()%>" height="280px" width="280px"/>
                                                    </div>
                                                    <div class="idEv" align="center">
                                                        <h3 style="color:black; margin-left: -280px;"><u>Id evento</u>:<%=evento.getId()%></h3>
                                                    </div>
                                                    <div class="dataEv" align="center">
                                                        <h3 style="color:black; margin-left: -145px;"><u>Data evento</u>: <%=data[2]+"-"+data[1]+"-"+data[0]%>&nbsp;&nbsp;&nbsp;&nbsp;<u>Ora:</u><%=evento.getOrari()%></h3>
                                                    </div>
                                                    <div class="descrizioneEv" style="color:black;" align="center">
                                                        <h3><u>Descrizione evento</u>:</h3>
                                                        <h4><%=evento.getDescrizioneEvento()%></h4>    
                                                    </div>
                                                </div>
                                                <div class="prezziEv">
                                                    <table style="background-color: black; width: 720px;">
                                                        <thead><tr class="riga_dispari"><th>Settore</th><th>Prezzo</th></tr></thead>
                                                        <tbody>
                                                        <tr><td></td><td></td></tr>
                                                        <tr class="riga_pari"><td>Parterre</td><td><%=evento.getPrezzoParterre()%>0€</td></td>
                                                        <tr class="riga_dispari"><td>Primo anello blu</td><td><%=evento.getPrezzoBlu()%>0€</td></td>
                                                        <tr class="riga_pari"><td>Primo anello verde</td><td><%=evento.getPrezzoVerde()%>0€</td></td>
                                                        <tr class="riga_dispari"><td>Secondo anello arancio</td><td><%=evento.getPrezzoArancio()%>0€</td></td>                            
                                                        <tr class="riga_pari"><td>Secondo anello giallo</td><td><%=evento.getPrezzoGiallo()%>0€</td></td>
                                                        <tr class="riga_dispari"><td>Curva rossa</td><td><%=evento.getPrezzoRosso()%>0€</td></td>                            
                                                    </table>
                                                </div>
                                            </div>
                                        <%}else{%>
                                            <h3>Errore update evento</h3>
                                        <%}%>
                                    <%}else if(op.equals("cancellaSingoloEvento")){
                                        Boolean result = (Boolean) request.getAttribute("result");    
                                        if(result){    
                                    %>
                                            <h2 style="color: red; text-align:center;">L'evento selezionato e' stato eliminato con successo</h2>
                                            <a href="amministrazione.jsp">Torna alla pagina di amministrazione</a>
                                        <%}else{%>
                                            <h2 style="color: red;">ERRORE: L'evento selezionato NON e' stato eliminato, riprovare</h2>
                                            <a href="amministrazione.jsp">Torna alla pagina di amministrazione</a>
                                        <%}%>
                                    <%}else if(op.equals("visualizzaEvento")){
                                        Evento evento = (Evento)request.getAttribute("dettaglievento");
                                        int postiparterre = (Integer)request.getAttribute("parterre");
                                        int postiarancio1 = (Integer)request.getAttribute("arancio1");
                                        int postiarancio2 = (Integer)request.getAttribute("arancio2");
                                        int postiblu1 = (Integer)request.getAttribute("blu1");
                                        int postiblu2 = (Integer)request.getAttribute("blu2");
                                        int postiverde = (Integer)request.getAttribute("verde");
                                        int postigiallo = (Integer)request.getAttribute("giallo");
                                        int postirosso1 = (Integer)request.getAttribute("rosso1");
                                        int postirosso2 = (Integer)request.getAttribute("rosso2");
                                        String [] data = evento.getDataEvento().toString().split("-");
                                    %>
                                        <div class="titoloEv">
                                            <h1><%=evento.getTitoloEvento()%></h1>
                                        </div> 
                                        <div class="locandinaEv">
                                            <%String locandina = evento.getLocandina().replace(".jpg", "2.jpg");%>
                                            <img class="imageborder" src="<%=locandina%>" height="280px" width="708px"/>
                                        </div>
                                        <div class="tabber">
                                            <div class="tabbertab">
                                                <h2>Maggiori Dettagli</h2>
                                                <p class="titolo"><b>Descrizione:</b></p>
                                                <h4><%=evento.getDescrizioneEvento()%></h4> 
                                            </div>
                                            <div class="tabbertab">
                                                <h2>Quando</h2><br>
                                                <p class="titoloInline"><b>Data Evento: </b></p><b><%=data[2]%>-<%=data[1]%>-<%=data[0]%></b><br><br>
                                                <p class="titoloInline"><b>Ora: </b></p><b><%=evento.getOrari()%></b><br><br>
                                            </div> 
                                            <div class="tabbertab">
                                                <h2>Acquista</h2> 
                                                <p class="titolo"><b>Elenco Prezzi:</b></p>
                                                <div class="prezziEv"> 
                                                <table class="elencoPrezzi">
                                                    <tr>                         
                                                        <td style="width: 250px;">Parterre</td>
                                                        <td><%=evento.getPrezzoParterre()%>0€</td>
                                                        <td>Posti liberi: <%=postiparterre%></td>
                                                        <form action="GeneralController" method="post">
                                                            <input type="hidden" name="settore" value="parterre"><input type="hidden" name="evento" value="<%=evento.getId()%>">
                                                            <td>
                                                            <%if(user==null){%>
                                                                <div style="float:right; margin-top:8px; margin-bottom:8px;">Effettua login per acquistare</div>
                                                            
                                                            <%}else{%>
                                                                <button type="submit" class="myButton blue" id="btnsubmit" name="submit" value="selezioneposto" style="float:right;">ACQUISTA</button>
                                                        
                                                            <%}%>
                                                            </td>
                                                        </form>
                                                    </tr>
                                                    <tr>
                                                       <td>Primo anello blu(blu1)</td>
                                                        <td><%=evento.getPrezzoBlu()%>0€</td>
                                                        <td>Posti liberi: <%=postiblu1%></td>
                                                        <form action="GeneralController" method="post">
                                                           <input type="hidden" name="settore" value="blu1"><input type="hidden" name="evento" value="<%=evento.getId()%>">
                                                            <td>
                                                                <%if(user==null){%>
                                                                    <div style="float:right; margin-top:8px; margin-bottom:8px;">Effettua login per acquistare</div>
                                                                <%}else{%>
                                                                    <button type="submit" class="myButton blue" id="btnsubmit" name="submit" value="selezioneposto" style="float:right;">ACQUISTA</button>
                                                                <%}%>   
                                                            </td>
                                                        </form>
                                                    </tr>                   
                                                    <tr>
                                                        <td>Primo anello blu(blu2)</td>
                                                        <td><%=evento.getPrezzoBlu()%>0€</td>
                                                        <td>Posti liberi: <%=postiblu2%></td>
                                                        <form action="GeneralController" method="post">
                                                            <input type="hidden" name="settore" value="blu2"><input type="hidden" name="evento" value="<%=evento.getId()%>">
                                                            <td>
                                                                <%if(user==null){%>
                                                                    <div style="float:right; margin-top:8px; margin-bottom:8px;">Effettua login per acquistare</div>
                                                                <%}else{%>
                                                                    <button type="submit" class="myButton blue" id="btnsubmit" name="submit" value="selezioneposto" style="float:right;">ACQUISTA</button>
                                                                <%}%>
                                                            </td>
                                                        </form>
                                                    </tr>
                                                    <tr>
                                                        <td>Primo anello verde</td>
                                                        <td><%=evento.getPrezzoVerde()%>0€</td>
                                                        <td>Posti liberi: <%=postiverde%></td>
                                                        <form action="GeneralController" method="post">
                                                            <input type="hidden" name="settore" value="verde"><input type="hidden" name="evento" value="<%=evento.getId()%>">                                                            <td>
                                                                <%if(user==null){%>
                                                                    <div style="float:right; margin-top:8px; margin-bottom:8px;">Effettua login per acquistare</div>
                                                                <%}else{%>
                                                                    <button type="submit" class="myButton blue" id="btnsubmit" name="submit" value="selezioneposto" style="float:right;">ACQUISTA</button>
                                                                <%}%>
                                                            </td>
                                                        </form>
                                                    </tr>
                                                    <tr>
                                                        <td>Secondo anello arancio(arancio1)</td>
                                                        <td><%=evento.getPrezzoArancio()%>0€</td>
                                                        <td>Posti liberi: <%=postiarancio1%></td>
                                                        <form action="GeneralController" method="post">
                                                            <input type="hidden" name="settore" value="arancio1"><input type="hidden" name="evento" value="<%=evento.getId()%>">                                                            <td>
                                                                <%if(user==null){%>
                                                                    <div style="float:right; margin-top:8px; margin-bottom:8px;">Effettua login per acquistare</div>
                                                                <%}else{%>
                                                                    <button type="submit" class="myButton blue" id="btnsubmit" name="submit" value="selezioneposto" style="float:right;">ACQUISTA</button>
                                                                <%}%>
                                                            </td>
                                                        </form>
                                                    </tr>
                                                    <tr>
                                                        <td>Secondo anello arancio(arancio2)</td>
                                                        <td><%=evento.getPrezzoArancio()%>0€</td>
                                                        <td>Posti liberi: <%=postiarancio2%></td>
                                                        <form action="GeneralController" method="post">
                                                            <input type="hidden" name="settore" value="arancio2"><input type="hidden" name="evento" value="<%=evento.getId()%>">                                                            <td>
                                                                <%if(user==null){%>
                                                                    <div style="float:right; margin-top:8px; margin-bottom:8px;">Effettua login per acquistare</div>
                                                                <%}else{%>
                                                                    <button type="submit" class="myButton blue" id="btnsubmit" name="submit" value="selezioneposto" style="float:right;">ACQUISTA</button>
                                                                <%}%>
                                                            </td>
                                                        </form>
                                                    </tr>
                                                    <tr>
                                                        <td>Secondo anello giallo</td>
                                                        <td><%=evento.getPrezzoGiallo()%>0€</td>
                                                        <td>Posti liberi: <%=postigiallo%></td>
                                                        <form action="GeneralController" method="post">
                                                            <input type="hidden" name="settore" value="giallo"><input type="hidden" name="evento" value="<%=evento.getId()%>">                                                            <td>
                                                                <%if(user==null){%>
                                                                    <div style="float:right; margin-top:8px; margin-bottom:8px;">Effettua login per acquistare</div>
                                                                <%}else{%>
                                                                    <button type="submit" class="myButton blue" id="btnsubmit" name="submit" value="selezioneposto" style="float:right;">ACQUISTA</button>
                                                                <%}%>
                                                            </td>
                                                        </form>
                                                    </tr>
                                                    <tr>
                                                        <td>Curva rossa(rosso1)</td>
                                                        <td><%=evento.getPrezzoRosso()%>0€</td>
                                                        <td>Posti liberi: <%=postirosso1%></td>
                                                        <form action="GeneralController" method="post">
                                                            <input type="hidden" name="settore" value="rosso1"><input type="hidden" name="evento" value="<%=evento.getId()%>">                                                            <td>
                                                                <%if(user==null){%>
                                                                    <div style="float:right; margin-top:8px; margin-bottom:8px;">Effettua login per acquistare</div>
                                                                <%}else{%>
                                                                    <button type="submit" class="myButton blue" id="btnsubmit" name="submit" value="selezioneposto" style="float:right;">ACQUISTA</button>
                                                                <%}%>
                                                            </td>
                                                        </form>
                                                    </tr>
                                                    <tr>
                                                        <td>Curva rossa(rosso2)</td>
                                                        <td><%=evento.getPrezzoRosso()%>0€</td>
                                                        <td>Posti liberi: <%=postirosso2%></td>
                                                        <form action="GeneralController" method="post">
                                                            <input type="hidden" name="settore" value="rosso2"><input type="hidden" name="evento" value="<%=evento.getId()%>">                                                            <td>
                                                                <%if(user==null){%>
                                                                    <div style="float:right; margin-top:8px; margin-bottom:8px;">Effettua login per acquistare</div>
                                                                <%}else{%>
                                                                    <button type="submit" class="myButton blue" id="btnsubmit" name="submit" value="selezioneposto" style="float:right;">ACQUISTA</button>
                                                                <%}%>
                                                            </td>
                                                        </form>
                                                    </tr>
                                                </table>
                                            </div>
                                            <br/>
                                            <a href="#" class="show_hide"><h4 style="text-align:center;">Guarda mappa palazzetto</h4><br></a>                                                                                             
                                            <div class="productDescription" align="center">                                                  
                                                  <img src="Images/palazzetto2.jpg"/>                                                  
                                            </div>
                                        </div>
                                    </div>
                                    <%}else if(op.equals("inserimentoEffettuato")){%>
                                        <div align="center">
                                            <h1>Inserimento effettuato con successo</h1>
                                            <h2><a href="homepage.jsp">Torna alla home</a>
                                            oppure
                                            <a href="amministrazione.jsp">Torna ad amministrazione</a>
                                            </h2>
                                        </div>
                                    <%}else if(op.equals("inserimentoNonEffettuato")){%>
                                        <div align="center">
                                            <h1 style='color:red;'>ERRORE nell'inserimento dell'evento</h1>
                                            <h2><a href="homepage.jsp">Torna alla home</a>
                                            oppure
                                            <a href="amministrazione.jsp">Torna ad amministrazione</a>
                                            </h2>
                                        </div>
                                    <%}%>
                               <%}%>
                            </div>
                        </div>
                        <div class="right-panel">
                            <div class="right-panel-in">
                                <jsp:include page="/GeneralController">
                                    <jsp:param name="submit" value="right-content"/>
                                    <jsp:param name="op" value="newsbox"/>
                                </jsp:include>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="footer">
                    <%@include file="footer.jsp" %> 
                </div>
            </div>
        </div> 
    </body>
</html>

